<?php
/**
 * TomatoCMS
 *
 * LICENSE
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE Version 2
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-2.0.txt
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@tomatocms.com so we can send you a copy immediately.
 *
 * @copyright    Copyright (c) 2009-2010 TIG Corporation (http://www.tig.vn)
 * @license        http://www.gnu.org/licenses/gpl-2.0.txt GNU GENERAL PUBLIC LICENSE Version 2
 * @version     $Id: Attribute.php 2793 2010-05-03 18:48:14Z huuphuoc $
 * @since        2.0.5
 */

interface Shop_Models_Interface_Value
{
    /**
    * Add value type
    * @param: $value_type Shop_Models_Value
    * @return: int
    **/
    public function add($value_type);

    /**
    * Update value type
    * @param: $value_type Shop_Models_Value
    * @return: void
    **/
    public function update($value_type);

    /**
    * Add value type content
    * @param: $value_content Shop_Models_Value
    * @return: int
    **/
    public function addContent($value_content);

    /**
    * Update value type content
    * @param: $value_content Shop_Models_Value
    * @return: void
    **/
    public function updateContent($value_content);

    /**
     * Get value by id
     * @param: $id Id of value type id
     * @return: Shop_Models_Value
    **/
    public function getById($id);

    /**
     * Get value content language
     * @param: $id Id of value type id
     * @return: Tomato_Model_RecordSet
    **/
    public function getValueContentById($id);

    /**
    * Update value chain for product and attribute
    * Delete value type and delete value content width value_type_id
    * @param $conditions array(): have product_id, attribute_type_id and value_type_id
    * @return: void
    **/
    public function delete($counditions);

    /**
     * Delete value type
     * @param int $id Id of value type
     * @return void
    **/
    public function deleteValue($id);

    /**
     * Delete value content
     * @param int $id Id of value type
     * @return void
    **/
    public function deleteValueContent($id);

    /**
     * Count value
     * @param int $id Id of value
     * @return int
    **/
    public function countValue($id);

    /**
     * Count value
     * @param int $id Id of value
     * @return int
    **/
    public function countValue1($id);

    /**=========================Front end===========================*/

    /**
    * Get values by string id
    * @param string $str String id of value
    * @return Tomato_Model_Recordset
    **/
    public function values($str);

    /**
     * Get value by id for front end follow language
     * @param: $id Id of value type id
     * @return: Shop_Models_Value
    **/
    public function getFEById($id);

    /**
     * Search value follow keyword
     * @param string $keyword
     * @return Tomato_Model_Recordset
    **/
    public function search($keyword);
}
